#pragma once

#include <QColorDialog>
#include <QLabel>
#include <QWidget>

#include "ClickableLabel.hpp"

class ColorPicker : public QWidget
{
    Q_OBJECT

public:
    explicit ColorPicker(QColor initColor = Qt::white, QWidget *parent = nullptr);

    QColor getColor() const;
    void   setColor(const QColor &color);

signals:
    void colorChanged(QColor newColor);

private slots:
    void onColorSetButtonClicked();

private:
    QColor          color;
    ClickableLabel *colorPreviewLabel;
    QLabel         *colorHexValueLabel;
    QColorDialog   *colorDialog;

    void setupUI();
    void connectSignals();
};
